home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Advisor / CD-ROM Advisor.iso / prodemo / pdymain.dir / 00006_Script_6 < prev    next >
Text File  |  1995-09-29  |  4KB  |  107 lines

  1. on mouseDown
  2.   global gIndexOfCurrentButton
  3.   global gMouseDownInButton  --TRUE means down was in a button...in case of rollout
  4.   global gIsMainButton, gIsSmallButton  --TRUE if a mouseDown in a main/small button
  5.   global gChannelForHighLights
  6.   global gNumberOfMainButtons
  7.   global gCentersOfMainButtons, gMagicOffsetsOfMainButtons, gCastMemsOfMainButtons
  8.   global gCentersOfSmallButtons, gMagicOffsetsOfSmallButtons, gCastMemsOfSmallButtons
  9.   global gSmallButtonsOn
  10.   
  11.   put the mouseH into hTemp
  12.   put the mouseV into vTemp
  13.   put isPositionWithinMainButton(hTemp, vTemp) into gIndexOfCurrentButton
  14.   if gIndexOfCurrentButton > 0 then
  15.     put TRUE into gMouseDownInButton
  16.     put TRUE into gIsMainButton
  17.     
  18.     set the castNum of sprite gChannelForHighLights to getAt(gCastMemsOfMainButtons, gIndexOfCurrentButton)
  19.     
  20.     --put "script 6, <enterFrame>, gMouseDownInButton = ", gMouseDownInButton
  21.     --put "script 6, <mouseDown>, gChannelForHighLights =", gChannelForHighLights
  22.     --put " the castNum of sprite gChannelForHighLights =", the castNum of sprite gChannelForHighLights
  23.     
  24.     
  25.     put getAt(gCentersOfMainButtons, gIndexOfCurrentButton) into centerTemp
  26.     put getAt(gMagicOffsetsOfMainButtons, gIndexOfCurrentButton) into offsetTemp
  27.     set the visible of sprite gChannelForHighLights to TRUE
  28.     set the ink of sprite gChannelForHighLights to 0
  29.     set the locH of sprite gChannelForHighLights to getAt(centerTemp, 1) + getAt(offsetTemp, 1)
  30.     set the locV of sprite gChannelForHighLights to getAt(centerTemp, 2) + getAt(offsetTemp, 2)
  31.   else
  32.     if gSmallButtonsOn then  --only check the small buttons if the flag is TRUE
  33.       put isPositionWithinSmallButton(hTemp, vTemp) into gIndexOfCurrentButton
  34.       if gIndexOfCurrentButton > 0 then
  35.         put TRUE into gMouseDownInButton
  36.         put TRUE into gIsSmallButton
  37.         set the castNum of sprite gChannelForHighLights to getAt(gCastMemsOfSmallButtons, gIndexOfCurrentButton)
  38.         put getAt(gCentersOfSmallButtons, gIndexOfCurrentButton) into centerTemp
  39.         put getAt(gMagicOffsetsOfSmallButtons, gIndexOfCurrentButton) into offsetTemp
  40.         set the visible of sprite gChannelForHighLights to TRUE
  41.         set the ink of sprite gChannelForHighLights to 0
  42.         set the locH of sprite gChannelForHighLights to getAt(centerTemp, 1) + getAt(offsetTemp, 1)
  43.         set the locV of sprite gChannelForHighLights to getAt(centerTemp, 2) + getAt(offsetTemp, 2)
  44.       end if
  45.     end if
  46.   end if
  47.   
  48. end mouseDown
  49.  
  50. on mouseUp
  51.   global gIndexOfCurrentButton
  52.   global gMouseDownInButton
  53.   global gIsMainButton, gIsSmallButton
  54.   global gChannelForHighLights
  55.   global gNumberOfMainButtons
  56.   global gLabelsForSmallButtonActions
  57.   global gAnisForMainButtons, gAniHasBeenViewed
  58.   global gNextLabel
  59.   global gMovieToPlay
  60.   global gSmallButtonsOn
  61.   
  62.   if gMouseDownInButton then
  63.     put the mouseH into hTemp
  64.     put the mouseV into vTemp
  65.     
  66.     if gIsMainButton then
  67.       put isPositionWithinMainButton (hTemp, vTemp) into iButtonTemp
  68.       if iButtonTemp = gIndexOfCurrentButton then
  69.         setAt gAniHasBeenViewed, gIndexOfCurrentButton, TRUE
  70.         put TRUE into gMovieToPlay
  71.         
  72.         put 0 into countOfViewed
  73.         repeat with iButCount = 1 to gNumberOfMainButtons
  74.           if getAt(gAniHasBeenViewed, iButCount) then
  75.             put (countOfViewed + 1) into countOfViewed
  76.           end if
  77.         end repeat
  78.         
  79.         if countOfViewed < gNumberOfMainButtons then
  80.           put "cont" into gNextLabel
  81.           put TRUE into gSmallButtonsOn
  82.         else
  83.           put "conc" into gNextLabel
  84.           put TRUE into gSmallButtonsOn
  85.         end if
  86.       end if
  87.     else
  88.       if gSmallButtonsOn and gIsSmallButton then
  89.         put isPositionWithinSmallButton (hTemp, vTemp) into iButtonTemp
  90.         if iButtonTemp = gIndexOfCurrentButton then
  91.           put getAt(gLabelsForSmallButtonActions, gIndexOfCurrentButton) into gNextLabel
  92.         end if
  93.       end if
  94.     end if
  95.   end if
  96.   
  97.   set the visible of sprite gChannelForHighLights to FALSE
  98.   --reset the Booleans
  99.   --don't reset <gMovieToPlay> because it tells <exitFrame> whether to run the movie
  100.   --don't reset <gIndexOfCurrentButton because it's needed to run the movie
  101.   put FALSE into gMouseDownInButton
  102.   put FALSE into gIsMainButton
  103.   put FALSE into gIsSmallButton
  104.   
  105.   
  106. end mouseUp
  107.